package com.ruoyi.production.service.impl.carton;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.production.mapper.carton.CartonAmountMapper;
import com.ruoyi.production.domain.carton.CartonAmount;
import com.ruoyi.production.service.carton.ICartonAmountService;

/**
 * 纸箱量Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-10
 */
@Service
public class CartonAmountServiceImpl implements ICartonAmountService
{
    @Autowired
    private CartonAmountMapper cartonAmountMapper;

    /**
     * 查询纸箱量
     *
     * @param cartonAmountId 纸箱量ID
     * @return 纸箱量
     */
    @Override
    public CartonAmount selectCartonAmountById(Long cartonAmountId)
    {
        return cartonAmountMapper.selectCartonAmountById(cartonAmountId);
    }

    /**
     * 查询纸箱量列表
     *
     * @param cartonAmount 纸箱量
     * @return 纸箱量
     */
    @Override
    public List<CartonAmount> selectCartonAmountList(CartonAmount cartonAmount)
    {
        return cartonAmountMapper.selectCartonAmountList(cartonAmount);
    }

    /**
     * 新增纸箱量
     *
     * @param cartonAmount 纸箱量
     * @return 结果
     */
    @Override
    public int insertCartonAmount(CartonAmount cartonAmount)
    {
        cartonAmount.setCreateTime(DateUtils.getNowDate());
        return cartonAmountMapper.insertCartonAmount(cartonAmount);
    }

    /**
     * 修改纸箱量
     *
     * @param cartonAmount 纸箱量
     * @return 结果
     */
    @Override
    public int updateCartonAmount(CartonAmount cartonAmount)
    {
        cartonAmount.setUpdateTime(DateUtils.getNowDate());
        return cartonAmountMapper.updateCartonAmount(cartonAmount);
    }

    /**
     * 批量删除纸箱量
     *
     * @param cartonAmountIds 需要删除的纸箱量ID
     * @return 结果
     */
    @Override
    public int deleteCartonAmountByIds(Long[] cartonAmountIds)
    {
        return cartonAmountMapper.deleteCartonAmountByIds(cartonAmountIds);
    }

    /**
     * 删除纸箱量信息
     *
     * @param cartonAmountId 纸箱量ID
     * @return 结果
     */
    @Override
    public int deleteCartonAmountById(Long cartonAmountId)
    {
        return cartonAmountMapper.deleteCartonAmountById(cartonAmountId);
    }
}
